﻿
using System;

using GECS.Object;

namespace GECS.MapEngine {

	/// <summary>
	/// This interface is used by the Map class to load the objects dynamically on
	/// demand. They are created by using the character used to represent them in
	/// the map file or in the MapInfo object.
	/// </summary>
    public interface MapLoader {

		/// <summary>
		/// Called by the Map to load objects dynamically. The character which is
		/// encountered in the map is passed as an argument along with the position
		/// (pixel) which can be used to align the object to the map's grid.
		/// </summary>
		/// <param name="c">The encountered character.</param>
		/// <param name="x">The x-position.</param>
		/// <param name="y">The y-position.</param>
		/// <returns>An object for the map created by the implementor.</returns>
        GObject GetObject(char c, int x, int y);

        /// <summary>
		/// Called by the Map to load tiles dynamically. The character which is
		/// encountered in the map is passed as an argument along with the position
		/// (pixel) which can be used to align the tile to the map's grid.
		/// </summary>
		/// <param name="c">The encountered character.</param>
		/// <param name="x">The x-position.</param>
		/// <param name="y">The y-position.</param>
		/// <returns>A tile for the map created by the implementor.</returns>
        Tile GetTile(char c, int x, int y);

    }

}
